EXERCISE 4: Now let's set up the wizard's other two spells as functions. Try it out!

  • Create a function named spell_2() at the bottom of the program.
  • Within spell_2(), put the code for the wizard to make treasure appear.
  • Create a function named spell_3() at the bottom of the program.
  • Within spell_3(), put the code for the wizard to call his pet dragon.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)